#include "Illumination.h"

bool Illumination::handleProperties(TiXmlElement *element, int &db, int &local) {

	if (element->QueryIntAttribute("doublesided", &db) == TIXML_SUCCESS &&
		element->QueryIntAttribute("local", &local)	   == TIXML_SUCCESS) {
			return NO_ERROR;
	}
	
	return ERROR;
}

bool Illumination::handleComponents(TiXmlElement *element, sRgba &amb) {

	if (element != NULL) {
		if (element->QueryFloatAttribute("r", &amb.r)	== TIXML_SUCCESS &&
			element->QueryFloatAttribute("g", &amb.g)	== TIXML_SUCCESS &&
			element->QueryFloatAttribute("b", &amb.b)   == TIXML_SUCCESS &&
			element->QueryFloatAttribute("a", &amb.a)   == TIXML_SUCCESS) {
				return NO_ERROR;
			}
	}

	return ERROR;
}